package com.lagou.ex.mybatis.base.service.impl;

import com.lagou.ex.mybatis.base.mapper.UserMapper;
import com.lagou.ex.mybatis.base.model.UserModel;
import com.lagou.ex.mybatis.base.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户操作
 */
@Service
@Slf4j
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<UserModel> queryByPhone(String phone) {
        log.info("/queryByPhone phone-{}", phone);
        return userMapper.queryByPhone(phone);
    }

    @Override
    public boolean createUser(UserModel userModel) {
        userModel.setId(null);
        log.info("/createUser bean-{}", userModel);
        return true;
    }

}
